\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}

\begin{document}

\section*{A}
INTERPOLATION.H

First,we should build up a Function class convenient for get value if function is known.

Second,we should build up classes for Newton and Hermite interpolation methods.The class
is made up with interpolation methods and print methods including printing coefficient and polynomial.We can also write a function to solve gotten polynomial's derivative.

Third,if we only know some points' values,we can build up a function convenient to input x and y.

\section*{B}

\subsection*{Analysis}
We should build a function Function1 to calculate the value,then we can get the vector x and y.The Newtonpolation method can help us achieve the polynomial.We should pay attention to
clearing x and y after every loop.

\subsection*{Result}
n=2,
$$y=0.038462\pi_{0}+0.192308\pi_{1}-0.038462\pi_{2}$$
n=4,
$$y=0.038462\pi_{0}+0.039788\pi_{1}+0.061008\pi_{2}-0.026525\pi_{3}+0.005305\pi_{4}$$
n=6,
$$y=0.038462\pi_{0}+0.026464\pi_{1}+0.024845\pi_{2}+0.014945\pi_{3}-0.013170\pi_{4}+0.004203\pi_{5}-0.000841\pi_{6}$$
n=8,
\begin{align*}
    y&=0.038462\pi_{0}+0.022343\pi_{1}+0.013956\pi_{2}+0.011704\pi_{3}+0.000674\pi_{4} \\
    &-0.004896\pi_{5}+0.002440\pi_{6}-0.000687\pi_{7}+0.000137\pi_{8}
\end{align*}

\subsection*{Image}
\includegraphics[scale=1.0]{B.jpg}

\section*{C}

\subsection*{Analysis}
We should build a function Function2 to calculate the value,then we can get the vector x and y.The Newtonpolation method can help us achieve the polynomial.We should pay attention to
clearing x and y after every loop.And the zeros of $T_{n}$ is $x=\cos{\frac{(k+\frac{1}{2})\pi}{n}}$.
\subsection*{Result}
n=5,
$$y=0.042350\pi_{0}-0.169057\pi_{1}+1.425479\pi_{2}+2.612075\pi_{3}+2.746498\pi_{4}$$
n=10,
\begin{align*}
    y&=0.039388\pi_{0}-0.088739\pi_{1}+0.189679\pi_{2}-0.534305\pi_{3}+2.116812\pi_{4} \\
    &8+.287432\pi_{5}+11.954307\pi_{6}+10.356817\pi_{7}+5.512772\pi_{8}-0.000000\pi_{9}
\end{align*}
n=15,
\begin{align*}
    y=&0.038870\pi_{0}-0.080068\pi_{1}+0.134961\pi_{2}-0.231498\pi_{3}+0.449158\pi_{4} \\
    &-1.047531\pi_{5}+2.339442\pi_{6}+14.028338\pi_{7}+6.935388\pi_{8}-47.535850\pi_{9} \\
    &-140.627825\pi_{10}-235.756180\pi_{11}-302.207596\pi_{12}-331.791382\pi_{13} \\
    &-333.618982\pi_{14}
\end{align*}
n=20,
\begin{align*}
    y&=0.038691\pi_{0}-0.077314\pi_{1}+0.120771\pi_{2}-0.178930\pi_{3}+0.271509\pi_{4} \\
    &-0.441458\pi_{5}+0.785471\pi_{6}-1.445651\pi_{7}+1.113646\pi_{8}+23.795470\pi_{9} \\
    &-24.127959\pi_{10}-331.451526\pi_{11}-965.900485\pi_{12}-1734.364108\pi_{13} \\
    &-2309.920881\pi_{14}-2462.382214\pi_{15}-2166.917227\pi_{16}-1552.441002\pi_{17} \\
    &-788.326334\pi_{18}+0.000000\pi_{19}
\end{align*}

\subsection*{Image}
\includegraphics[scale=1.0]{C.jpg}

\section*{D}

\subsection*{Analysis}
We push the data into vector x and y.Then we can get the polynomial,then bring $t=10$ into
it and its derivative.Then,we observe whether the curve will intersect with $y=81$.  

\subsection*{Result}
\begin{align*}
    y&=0.000000\pi_{0}+75.000000\pi_{1}+0.000000\pi_{2}+0.222222\pi_{3}-0.031111\pi_{4} \\
    &-0.006444\pi_{5}+0.002264\pi_{6}-0.000913\pi_{7}+0.000131\pi_{8}-0.000020\pi_{9}
\end{align*}
(a)The position of the car is 742.478500 and its speed is 48.394400.

(b)We can observe that the curve is intersected with $y=81$.So the car exceed speed limit.
\subsection*{Image}
\subsubsection*{Distance}
\includegraphics[scale=0.7]{D1.jpg}
\subsubsection*{Speed}
\includegraphics[scale=0.7]{D2.jpg}

\section*{E}

\subsection*{Analysis}
We push the data into vector x,y and z.Then we can get two polynomials.We can observe the curve to judge whether larvae will die.

\subsection*{Result}
Sp1:
\begin{equation*}
    y=6.670000\pi_{0}+1.771667\pi_{1}+0.457833\pi_{2}-0.124778\pi_{3}+0.013566\pi_{4}-0.000978\pi_{5}+0.000041\pi_{6}
\end{equation*}
Sp2:
\begin{equation*}
    y=6.670000\pi_{0}+1.571667\pi_{1}-0.087167\pi_{2}-0.015273\pi_{3}+0.002579\pi_{4}-0.000205\pi_{5}+0.000009\pi_{6}
\end{equation*}

Sp1 will die in about first day,but it will reborn.Sp1 and Sp2 won't die after another 15 days.
\subsection*{Image}
\includegraphics[scale=0.8]{E.jpg}


\end{document}

